<? include ("../init.php") ?>
<? include ("../header.php") ?>
<? include ("../menu.php") ?>
<? include ("submenu.php") ?>

<div id = "body">

<h1><?_l('edit')?> <?_l('user')?></h1>
<div class = "clear"></div>

<?
  $uid = $_GET['uid'];
  $sql = "SELECT * FROM user WHERE uid = $uid";
  $line = $db->queryUniqueObject($sql);
?>

<form method="post" action="update.php" class = "form">

  <input type = "hidden" value = "<?=$uid?>" name = "uid">

  <div class = "field"><label><?_l('username')?></label><input type = "text" name = "username" class = "input size1" value = "<?=$line->username?>"></div>
  <div class = "field"><label><?_l('password')?></label><input type = "text" name = "password" class = "input size1" value = "<?=$line->password?>"></div>
  <div class = "field"><label><?_l('name')?></label><input type = "text" name = "name" class = "input size1"  value = "<?=$line->name?>"></div>
  <div class = "field"><label><?_l('gender')?></label><input type= "text" name = "gender" class = "input size1"  value = "<?=$line->gender?>"></div>
  <div class = "field"><label><?_l('birthday')?></label><input type= "text" name = "birthday" class = "input size1"  value = "<?=$line->birthday?>"></div>
  <div class = "field"><label><?_l('job')?></label><input type= "text" name = "jobtype" class = "input size1"  value = "<?=$line->job?>"></div>
  <div class = "field"><label><?_l('address')?></label><input type = "text" name = "address" class = "input size1"  value = "<?=$line->address?>"></div>
  <div class = "field"><label><?_l('province')?></label>
    <select>
      <?
        $rsspro = $db->query("SELECT * FROM province");
        while ($linepro = $db->fetchNextObject($rsspro)){
           if($linepro->province == $line->province){
            echo "<option value = '".$linepro->province."' selected>".$linepro->province."</option>\n";
          }else{
            echo "<option value = '".$linepro->province."'>".$linepro->province."</option>\n";
          }
        }
      ?>
    </select> 
  </div>
  <div class = "field"><label><?_l('country')?></label><input type = "text" name = "country" class = "input size1"  value = "<?=$line->country?>"></div>
  <div class = "field"><label><?_l('zipcode')?></label><input type = "text" name = "zipcode" class = "input size1"  value = "<?=$line->zipcode?>"></div>
  <div class = "field"><label><?_l('groupuser')?></label><input type = "text" name = "groupuser" class = "input size1" value = "<?=$line->groupuser?>"></div>
  <div class = "field"><label></label>
    <input type="submit" name="save" value="<?_l('submit')?>" class = "btn" />
    <input onclick = "javascript:history.back(1)" type = "button" value="<?_l('cancel')?>" class = "btn" />
  </div>
</form>

</div>

<style>
  .form label {
    width:120px;
  }
</style>

<? include ("../footer.php") ?>